package com.pay.game.central.web.controller;

import com.pay.game.central.common.Result;
import com.pay.game.central.common.ResultGenerator;
import com.pay.game.central.web.service.ClearDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 清理系统垃圾数据
 */
@Controller
@RequestMapping("/clearData")
public class ClearDataController {

    @Autowired
    ClearDataService clearDataService;


    /**
     * 删除没用的店铺和商品
     */
    @ResponseBody
    @PostMapping("/storeAndGoods")
    public Result<Boolean> clearStoreAndGoods(){
        clearDataService.clearStoreAndGoods();
        return ResultGenerator.genSuccessResult(true);
    }

}
